package com.aric.springbootmusic.entity.param;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class EditUserParam {
    @NotBlank(message = "主键不能为空!")
    private String id;
    @NotBlank(message = "昵称不能为空!")
    private String nickname;
    @NotBlank(message = "邮箱不能为空!")
    @Email(message="邮箱不符合规则",regexp="^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$")
    private String email;
    @NotBlank(message = "手机号不能为空!")
    @Pattern(regexp="^1\\d{10}$|^(0\\d{2,3}-?|\\(0\\d{2,3}\\))?[1-9]\\d{4,7}(-\\d{1,8})?$",message = "电话号码不符合规则")
    private String phoneNumber;
}
